package com.aaa.gs.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRule {
    /***
     * 负载均衡策略配置
     * @return
     */
    @Bean
    public IRule iRule(){
        // 设置负载均衡策略为随机
        return new RoundRobinRule();
    }
}
